{% extends "bills/base.html" %}
{% block meta %} <meta http-equiv="refresh" content="60" > {% endblock %}
{% block body_main %}

<form action="{% url bills.views.bill_filter_state %}" method="POST">
{% csrf_token %}
<p>
 <button type="submit"> Применить </button>
 {{ fsform.draft.label }} {{ fsform.draft }} |
 {{ fsform.onway.label }} {{ fsform.onway }} |
 {{ fsform.done.label }}  {{ fsform.done }} |
 {{ fsform.dead.label }}  {{ fsform.dead }}
</p>
</form>

<table width="100%" border="1">
<thead>
 <tr>
  <th> # </th>
  <th> Объект </th>
  <th> Направление </th>
  <th> Поставщик </th>
  <th> Подписант </th>
  <th> Состояние </th>
 </tr>
</thead>
<tbody>
{% for object in object_list %}

 <tr>
  <td> <a href="{% url bills.views.bill_view object.pk %}"> {{ object.pk }} </a> </td>
  <td> {{ object.project }} </td>
  <td> {{ object.depart }} </td>
  <td> {{ object.supplier }} </td>
  <td> {{ object.approve }} </td>
  <td>
   {% if object.isalive %}
    {% if object.isgood %} В пути {% else %} Черновик {% endif %}
   {% else %}
    {% if object.isgood %} Исполнен {% else %} Завернут {% endif %}
   {% endif %}
  </td>
 </tr>
{% endfor %}
</tbody>
</table>
<!-- ACL: root|Исполнитель -->
{% if canadd %}
<a href="{% url bills.views.bill_add %}"> <button type="button"> + </button> </a>
{% endif %}
{% endblock %}
